package com.zdsoft.crm.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
public abstract class BaseController {

	@Autowired
	HttpServletRequest request;

	@Autowired
	HttpSession session;
	
	public Object getCurUser() {
		// ServletActionContext.getRequest()
		Object userObj = request.getSession().getAttribute("user");
		if (userObj == null)
			return "";
		return userObj;
	}
	
	public void attSession(String name, Object value){
		session.setAttribute(name, value);
	}
	
	public void attRequest(String name, Object value){
		request.setAttribute(name, value);
	}
}
